!function(t){function e(e,r,a){var o=this;return this.on("click.pjax",e,function(e){var i=t.extend({},g(r,a));i.container||(i.container=t(this).attr("data-pjax")||o),n(e,i)})}function n(e,n,r){r=g(n,r);var o=e.currentTarget;if("A"!==o.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";if(!(e.which>1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||location.protocol!==o.protocol||location.hostname!==o.hostname||o.href.indexOf("#")>-1&&x(o)==x(location)||e.isDefaultPrevented())){var i={url:o.href,container:t(o).attr("data-pjax"),target:o},s=t.extend({},i,r),c=t.Event("pjax:click");t(o).trigger(c,[s]),c.isDefaultPrevented()||(a(s),e.preventDefault(),t(o).trigger("pjax:clicked",[s]))}}function r(e,n,r){r=g(n,r);var o=e.currentTarget,i=t(o);if("FORM"!==o.tagName.toUpperCase())throw"$.pjax.submit requires a form element";var s={type:(i.attr("method")||"GET").toUpperCase(),url:i.attr("action"),container:i.attr("data-pjax"),target:o};if("GET"!==s.type&&void 0!==window.FormData)s.data=new FormData(o),s.processData=!1,s.contentType=!1;else{if(t(o).find(":file").length)return;s.data=t(o).serializeArray()}a(t.extend({},s,r)),e.preventDefault()}function a(e){e=t.extend(!0,{},t.ajaxSettings,a.defaults,e),t.isFunction(e.url)&&(e.url=e.url());var n,r=e.target,o=v(e.url).hash,s=e.context=j(e.container);function c(e,n,a){a||(a={}),a.relatedTarget=r;var o=t.Event(e,a);return s.trigger(o,n),!o.isDefaultPrevented()}e.data||(e.data={}),t.isArray(e.data)?e.data.push({name:"_pjax",value:s.selector}):e.data._pjax=s.selector,e.beforeSend=function(t,r){if("GET"!==r.type&&(r.timeout=0),t.setRequestHeader("X-PJAX","true"),t.setRequestHeader("X-PJAX-Container",s.selector),!c("pjax:beforeSend",[t,r]))return!1;r.timeout>0&&(n=setTimeout(function(){c("pjax:timeout",[t,e])&&t.abort("timeout")},r.timeout),r.timeout=0);var a=v(r.url);o&&(a.hash=o),e.requestUrl=m(a)},e.complete=function(t,r){n&&clearTimeout(n),c("pjax:complete",[t,r,e]),c("pjax:end",[t,e])},e.error=function(t,n,r){var a=b("",t,e),o=c("pjax:error",[t,n,r,e]);"GET"==e.type&&"abort"!==n&&o&&i(a.url)},e.success=function(n,r,u){var l=a.state,p="function"==typeof t.pjax.defaults.version?t.pjax.defaults.version():t.pjax.defaults.version,f=u.getResponseHeader("X-PJAX-Version"),h=b(n,u,e),m=v(h.url);if(o&&(m.hash=o,h.url=m.href),p&&f&&p!==f)i(h.url);else if(h.contents){if(a.state={id:e.id||d(),url:h.url,title:h.title,container:s.selector,fragment:e.fragment,timeout:e.timeout},(e.push||e.replace)&&window.history.replaceState(a.state,h.title,h.url),t.contains(e.container,document.activeElement))try{document.activeElement.blur()}catch(t){}h.title&&(document.title=h.title),c("pjax:beforeReplace",[h.contents,e],{state:a.state,previousState:l}),s.html(h.contents);var x=s.find("input[autofocus], textarea[autofocus]").last()[0];x&&document.activeElement!==x&&x.focus(),function(e){if(!e)return;var n=t("script[src]");e.each(function(){var e=this.src,r=n.filter(function(){return this.src===e});if(!r.length){var a=document.createElement("script"),o=t(this).attr("type");o&&(a.type=o),a.src=t(this).attr("src"),document.head.appendChild(a)}})}(h.scripts);var g=e.scrollTo;if(o){var j=decodeURIComponent(o.slice(1)),y=document.getElementById(j)||document.getElementsByName(j)[0];y&&(g=t(y).offset().top)}"number"==typeof g&&t(window).scrollTop(g),c("pjax:success",[n,r,u,e])}else i(h.url)},a.state||(a.state={id:d(),url:window.location.href,title:document.title,container:s.selector,fragment:e.fragment,timeout:e.timeout},window.history.replaceState(a.state,document.title)),f(a.xhr),a.options=e;var u,l,p=a.xhr=t.ajax(e);return p.readyState>0&&(e.push&&!e.replace&&(u=a.state.id,l=h(s),T[u]=l,S.push(u),P(E,0),P(S,a.defaults.maxCacheLength),window.history.pushState(null,"",e.requestUrl)),c("pjax:start",[p,e]),c("pjax:send",[p,e])),a.xhr}function o(e,n){var r={url:window.location.href,push:!1,replace:!0,scrollTo:!1};return a(t.extend(r,g(e,n)))}function i(t){window.history.replaceState(null,"",a.state.url),window.location.replace(t)}var s=!0,c=window.location.href,u=window.history.state;function l(e){s||f(a.xhr);var n,r=a.state,o=e.state;if(o&&o.container){if(s&&c==o.url)return;if(r){if(r.id===o.id)return;n=r.id",{method:"GET"===r?"GET":"POST",action:n,style:"display:none"});"GET"!==r&&"POST"!==r&&a.append(t("",{type:"hidden",name:"_method",value:r.toLowerCase()}));var o=e.data;if("string"==typeof o)t.each(o.split("&"),function(e,n){var r=n.split("=");a.append(t("",{type:"hidden",name:r[0],value:r[1]}))});else if(t.isArray(o))t.each(o,function(e,n){a.append(t("",{type:"hidden",name:n.name,value:n.value}))});else if("object"==typeof o){var i;for(i in o)a.append(t("",{type:"hidden",name:i,value:o[i]}))}t(document.body).append(a),a.submit()}function f(e){e&&e.readyState<4&&(e.onreadystatechange=t.noop,e.abort())}function d(){return(new Date).getTime()}function h(t){var e=t.clone();return e.find("script").each(function(){this.src||jQuery._data(this,"globalEval",!1)}),[t.selector,e.contents()]}function m(t){return t.search=t.search.replace(/([?&])(_pjax|_)=[^&]*/g,""),t.href.replace(/\?($|#)/,"$1")}function v(t){var e=document.createElement("a");return e.href=t,e}function x(t){return t.href.replace(/#.*/,"")}function g(e,n){return e&&n?n.container=e:n=t.isPlainObject(e)?e:{container:e},n.container&&(n.container=j(n.container)),n}function j(e){if((e=t(e)).length){if(""!==e.selector&&e.context===document)return e;if(e.attr("id"))return t("#"+e.attr("id"));throw"cant get selector for pjax container!"}throw"no pjax container for "+e.selector}function y(t,e){return t.filter(e).add(t.find(e))}function w(e){return t.parseHTML(e,document,!0)}function b(e,n,r){var a={},o=/]*>([\s\S.]*)<\/head>/i)[0])),c=t(w(e.match(/]*>([\s\S.]*)<\/body>/i)[0]));else s=c=t(w(e));if(0===c.length)return a;if(a.title=y(s,"title").last().text(),r.fragment){if("body"===r.fragment)var u=c;else u=y(c,r.fragment).first();u.length&&(a.contents="body"===r.fragment?u:u.contents(),a.title||(a.title=u.attr("title")||u.data("title")))}else o||(a.contents=c);return a.contents&&(a.contents=a.contents.not(function(){return t(this).is("title")}),a.contents.find("title").remove(),a.scripts=y(a.contents,"script[src]").remove(),a.contents=a.contents.not(a.scripts)),a.title&&(a.title=t.trim(a.title)),a}u&&u.container&&(a.state=u),"state"in window.history&&(s=!1);var T={},E=[],S=[];function P(t,e){for(;t.length>e;)delete T[t.shift()]}function C(){return t("meta").filter(function(){var e=t(this).attr("http-equiv");return e&&"X-PJAX-VERSION"===e.toUpperCase()}).attr("content")}function A(){t.fn.pjax=e,t.pjax=a,t.pjax.enable=t.noop,t.pjax.disable=D,t.pjax.click=n,t.pjax.submit=r,t.pjax.reload=o,t.pjax.defaults={timeout:650,push:!0,replace:!1,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20,version:C},t(window).on("popstate.pjax",l)}function D(){t.fn.pjax=function(){return this},t.pjax=p,t.pjax.enable=A,t.pjax.disable=t.noop,t.pjax.click=t.noop,t.pjax.submit=t.noop,t.pjax.reload=function(){window.location.reload()},t(window).off("popstate.pjax",l)}t.inArray("state",t.event.props)<0&&t.event.props.push("state"),t.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),t.support.pjax?A():D()}(jQuery);